public class AchieveToString {


    public static void achiv(int[] arr){
        String str = "";
        str += '[';
        for(int i = 0; i < arr.length; i++){
            str += arr[i];
            if(i < arr.length-1) {
                str += ',';
            }
        }
        str += ']';
        System.out.println(str);
    }

    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4};
        achiv(arr);
    }
}
